#ifndef Texture_h
#define Texture_h

#include <d3d9.h>
#include <d3dx9.h>
class Texture
{
public:
	Texture()
	{
		_Image = NULL;
	}
	~Texture()
	{
		//_Image->Release();
	}
	void LoadImage(LPDIRECT3DDEVICE9 d3ddv, LPWSTR FilePath)
	{
		D3DXIMAGE_INFO info;
		HRESULT result;
		if(!SUCCEEDED( D3DXGetImageInfoFromFile(FilePath, &info)))
			return ;
		result = D3DXCreateTextureFromFileEx(d3ddv,
			FilePath,
			info.Width,
			info.Height,
			1,
			D3DUSAGE_DYNAMIC,
			D3DFMT_UNKNOWN,
			D3DPOOL_DEFAULT,
			D3DX_DEFAULT,
			D3DX_DEFAULT,
			D3DCOLOR_XRGB(0,0,0),
			&info,
			NULL,
			&_Image);

		if(result!=D3D_OK)
		{
			return;
		}
	}
	LPDIRECT3DTEXTURE9 GetImage()
	{
		return _Image;
	}
private :
		LPDIRECT3DTEXTURE9 _Image;
};

#endif 
